package com.jsu.information.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.example.model.information.pojo.Achievement;
import org.example.model.information.pojo.AchievementTry;
import org.example.model.user.pojo.User;

import java.util.List;

@Mapper
public interface AchievementMapper extends BaseMapper<Achievement> {
    int insert(AchievementTry achievementTry);


    int update(AchievementTry achievementTry);

    @Select("SELECT * FROM achievement WHERE achievement_name LIKE CONCAT('%', #{keyword}, '%') " +
            "OR achievement_content LIKE CONCAT('%', #{keyword}, '%') " +
            "OR type LIKE CONCAT('%', #{keyword}, '%') " +
            "OR achievement_id LIKE CONCAT('%', #{keyword}, '%')")
    List<Achievement> searchAchievementByKeyword(@Param("keyword") String keyword);


}
